﻿<ValidationProperty("SelectedValue")>
Partial Class wuc_CustomDropDownList
    Inherits System.Web.UI.UserControl

    Public Property CssClass() As String
        Get
            Return Me.MainDropDownList.CssClass
        End Get
        Set(ByVal value As String)
            Me.MainDropDownList.CssClass = value
        End Set
    End Property

    Public Property DataSource() As Object
        Get
            Return Me.MainDropDownList.DataSource
        End Get
        Set(ByVal value As Object)
            Me.MainDropDownList.DataSource = value
        End Set
    End Property

    Public Property DataSourceID() As String
        Get
            Return Me.MainDropDownList.DataSourceID
        End Get
        Set(ByVal value As String)
            Me.MainDropDownList.DataSourceID = value
        End Set
    End Property

    Public Property DataTextField() As String
        Get
            Return Me.MainDropDownList.DataTextField
        End Get
        Set(ByVal value As String)
            Me.MainDropDownList.DataTextField = value
        End Set
    End Property

    Public Property DataValueField() As String
        Get
            Return Me.MainDropDownList.DataValueField
        End Get
        Set(ByVal value As String)
            Me.MainDropDownList.DataValueField = value
        End Set
    End Property

    Public Property AutoPostBack() As Boolean
        Get
            Return Me.MainDropDownList.AutoPostBack
        End Get
        Set(ByVal value As Boolean)
            Me.MainDropDownList.AutoPostBack = value
        End Set
    End Property

    Public Property SelectedValue() As String
        Get
            Return Me.MainDropDownList.SelectedValue
        End Get
        Set(ByVal value As String)
            Me.MainDropDownList.SelectedValue = value
        End Set
    End Property

    Public Property SelectedIndex() As Integer
        Get
            Return Me.MainDropDownList.SelectedIndex
        End Get
        Set(ByVal value As Integer)
            Me.MainDropDownList.SelectedIndex = value
        End Set
    End Property

    Public Property Enabled As Boolean
        Get
            Return Me.MainDropDownList.Enabled
        End Get
        Set(ByVal value As Boolean)
            Me.MainDropDownList.Enabled = value
        End Set
    End Property

    Public ReadOnly Property SelectedItem() As ListItem
        Get
            Return Me.MainDropDownList.SelectedItem
        End Get
    End Property

    Public ReadOnly Property Items() As WebControls.ListItemCollection
        Get
            Return Me.MainDropDownList.Items
        End Get
    End Property

    Public Event DataBound(ByVal sender As Object, ByVal e As EventArgs)
    Public Event SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

    Public Property LabelName() As String
        Get
            Return Me.LabelNameHiddenField.Value
        End Get
        Set(ByVal value As String)
            Me.LabelNameHiddenField.Value = value
        End Set
    End Property

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

    End Sub

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

        'Me.MainLabel.Text = Utilities.getLabel(Me._LabelName, "LABEL")
    End Sub

    Protected Sub MainDropDownList_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainDropDownList.DataBound
        RaiseEvent DataBound(sender, e)
    End Sub

    Protected Sub MainDropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainDropDownList.SelectedIndexChanged
        RaiseEvent SelectedIndexChanged(sender, e)
    End Sub
End Class
